package com.yand.optimization.ifelse.way3;



import java.util.HashMap;
import java.util.Map;

public class RoleFactory {

    private static Map<String, Role> roleMap = new HashMap<>();

    static{
        roleMap.put("ROLE_ROOT_ADMIN",new RootRole());
        roleMap.put("ROLE_ORDER_ADMIN",new OrderRole());
        roleMap.put("ROLE_NORMAL",new NormalRole());
    }



    public static Role getRole(String name){

        return roleMap.get(name);
    }


}
